from lxml import etree
import requests

url='https://pvp.qq.com/web201605/herolist.shtml'
headers={
    'User-Agent':
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0'
}
response = requests.get(url=url, headers=headers)

# print(response.text)

response.encoding = 'utf-8'
html = etree.HTML(response.text)
liList = html.xpath('/html/body/div[3]/div/div/div[2]/div[2]/ul/li/a/text()')
for li in liList:
    print(li)